#include <sstream>
#include "inefficient.h"

string uint32_t_to_str(uint32_t myint)
{
	stringstream tempstr;
	tempstr<<myint;
	return tempstr.str();
}

double stdev(uint32_t * numbers)
{
	//TODO
	return 0;
}

gettime::gettime()
{
	uint32_t year,month,day,hour,min,sec;
#ifdef _MSC_VER
	SYSTEMTIME st;
	GetLocalTime(&st);
	char temp[5];
	sprintf_s(temp,5,"%04d",st.wYear);
	year=atoi(temp);
	sprintf_s(temp,3,"%02d",st.wMonth);
	month=atoi(temp);
	sprintf_s(temp,3,"%02d",st.wDay);
	day=atoi(temp);
	sprintf_s(temp,3,"%02d",st.wHour);
	hour=atoi(temp);
	sprintf_s(temp,3,"%02d",st.wMinute);
	min=atoi(temp);
	sprintf_s(temp,3,"%02d",st.wSecond);
	sec=atoi(temp);
	sprintf_s(time_v,20,"%04d-%02d-%02d %02d:%02d:%02d",year,month,day,hour,min,sec);
	sprintf_s(time_s,16,"%04d%02d%02d_%02d%02d%02d",year,month,day,hour,min,sec);
#else
	struct tm *mytm;
	time_t mytime;
	time(&mytime);
	mytm=gmtime(&mytime);
	year=mytm->tm_year+1900;
	month=mytm->tm_mon+1;
	day=mytm->tm_mday;
	hour=mytm->tm_hour;
	min=mytm->tm_min;
	sec=mytm->tm_sec;
	sprintf(time_v,"%04d-%02d-%02d %02d:%02d:%02d",year,month,day,hour,min,sec);
	sprintf(time_s,"%04d%02d%02d_%02d%02d%02d",year,month,day,hour,min,sec);
#endif
}
